import { myRequest } from './api.js'

// 创建订单
const createOrder = async function(params) {
	return await myRequest({url: '/client/order/submit', data: params, method: 'POST'})
}

// 支付订单
const orderPay = async function(params) {
	return await myRequest({url: '/client/order/pay', data: params, method: 'POST'})
}

// 订单列表用户端
const orderListClient = async function(params) {
	return await myRequest({url: '/client/order/list', data: params})
}

// 根据id获取订单详情用户端
const orderClientFind = async function(params) {
	return await myRequest({url: '/client/order/find', data: params})
}

// 关闭订单（待付款、待响应）
const orderClose = async function(params) {
	return await myRequest({url: '/client/order/close', data: params})
}

// 完成订单
const orderFinish = async function(params) {
	return await myRequest({url: '/client/order/finish', data: params, method: 'POST'})
}

// 评价订单
const orderAppraisal = async function(params) {
	return await myRequest({url: '/client/order/appraisal', data: params, method: 'POST'})
}

// 会员卡下单
const createdOrderCard = async function(params) {
	return await myRequest({url: '/client/card/submit', data: params, method: 'POST'})
}

// 会员卡支付
const vipCardPay = async function(params) {
	return await myRequest({url: '/client/card/pay', data: params, method: 'POST'})
}

// 创建订单页
const createOrderPrice = async function(params) {
	return await myRequest({url: '/client/order/create', data: params})
}

export {
	createOrder,
	orderPay,
	orderListClient,
	orderClientFind,
	orderClose,
	orderFinish,
	orderAppraisal,
	createdOrderCard,
	vipCardPay,
	createOrderPrice
}